'''
Created on 2013-3-25

@author: zhiyong.luo
'''
from framework.bottle import Bottle, debug,redirect, static_file
from google.appengine.ext.webapp.util import run_wsgi_app

from app.index import indexc
from app.words import wordc

#root app
root = Bottle()
root.mount("/index.html", indexc)
root.mount("/words", wordc)

#redirect to index
@root.route("/")
def index():
    redirect("/index.html")


#handle static file 
@root.route("/static/<filepath:path>")
def staticFile(filepath):
    return static_file(filepath, root='static/')


def main():
    debug(True)
    run_wsgi_app(root)
 
if __name__=="__main__":
    main()